﻿<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:properties="clr-namespace:KBS.FamilyLines.Properties" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" x:Class="KBS.FamilyLines.Welcome">
    <UserControl.Resources>
        <DataTemplate x:Key="RecentFilesDataTemplate">
            <Button Content="{TemplateBinding Content}"/>
        </DataTemplate>

        <Style x:Key="WelcomeButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="Width" Value="Auto"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="FontFamily" Value="Calibri,Tahoma"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="bd" Padding="5,0,0,0">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" Margin="5,1,0,1"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true"/>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Cursor" Value="Hand"/>
                                <Setter Property="Background" TargetName="bd" Value="#FF29367B"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="RecentFileButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="Width" Value="Auto"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="FontFamily" Value="Calibri,Arial"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="bd" Padding="5,0,0,0">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" Margin="5,1,0,1"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true"/>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Cursor" Value="Hand"/>
                                <Setter Property="Background" TargetName="bd" Value="#FF29367B"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <StackPanel>

        <!-- Header -->
        <Border 
            MinWidth="300" 
            Width="Auto" 
            Padding="5,0,5,0" 
            Opacity="0.8"
            Background="{DynamicResource WelcomeBackgroundBrush}"
            BorderBrush="{DynamicResource BorderBrush}"
            BorderThickness="1,1,1,0"
            CornerRadius="15,0,0,0"
            HorizontalAlignment="Center" 
                >
            <Grid>
                <Rectangle 
                    Fill="{DynamicResource WelcomeHeaderBg}"
                    Height="69"
                        />
                <TextBlock 
                    Padding="4,0,0,0" 
                    Text="{x:Static properties:Resources.Welcome}" 
                    TextWrapping="Wrap" 
                    Foreground="{DynamicResource WelcomeHeaderFontColor}" 
                    FontSize="18" 
                    FontWeight="Bold" 
                    d:LayoutOverrides="Height" 
                    HorizontalAlignment="Left" 
                    Margin="3.5,0,0,2" 
                    VerticalAlignment="Bottom"/>
            </Grid>
        </Border>

        <!-- Content -->
        <Border 
            MinWidth="300" 
            Width="Auto" 
            BorderBrush="{DynamicResource BorderBrush}" 
            BorderThickness="1,1,1,1"
                >
            <Grid
                Margin="0,0,0,0" 
                Background="{DynamicResource InputBackgroundBrush}"
                    >
                <Grid.RowDefinitions>
                    <RowDefinition 
                        Height="Auto"
                            />
                    <RowDefinition 
                        Height="*"
                            />
                </Grid.RowDefinitions>
                <StackPanel 
                    HorizontalAlignment="Stretch" 
                    Margin="5,20,5,10"
                        >
                    <Button
                        Margin="0,0,0,5" 
                        x:Name="NewButton" 
                        Content="{x:Static properties:Resources.NewMenu}" 
                        Click="NewButton_Click" 
                        IsDefault="True" 
                        HorizontalAlignment="Stretch" 
                        Style="{DynamicResource WelcomeButtonStyle}" 
                        Width="Auto"
                            />
                    <Button 
                        Margin="0,0,0,5" 
                        x:Name="OpenButton" 
                        Content="{x:Static properties:Resources.OpenMenu}" 
                        Click="OpenButton_Click" 
                        HorizontalAlignment="Stretch" 
                        Style="{DynamicResource WelcomeButtonStyle}" 
                        Width="Auto"
                            />
                    <Button 
                        Margin="0,0,0,5"
                        x:Name="ImportButton" 
                        Content="{x:Static properties:Resources.GedcomMenu}" 
                        Click="ImportButton_Click" 
                        HorizontalAlignment="Stretch" 
                        Style="{DynamicResource WelcomeButtonStyle}" 
                        Width="Auto"
                            />
                </StackPanel>

                <GridSplitter
                    IsEnabled="False" 
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Bottom" 
                    Height="1"
                    Background="#FF3D4976" 
                    Margin="2,0,2,0"
                        />

                <Label 
                    Content="{x:Static properties:Resources.OpenRecent}" 
                    HorizontalAlignment="Left" 
                    VerticalAlignment="Top" 
                    Grid.Row="1" 
                    Margin="10,0,0,0" 
                    Foreground="#FFB5C8D8"
                        />

                <StackPanel 
                    MaxWidth="280" 
                    VerticalAlignment="Stretch"
                    Grid.Row="1" 
                    x:Name="RecentFilesStackPanel" 
                    Margin="5,30,5,10"
                        />

            </Grid>
        </Border>

        <!-- Footer -->
        <Border 
            Background="{DynamicResource BackgroundBrush}" 
            Height="30" 
            Opacity="0.8" 
            BorderBrush="{DynamicResource BorderBrush}" 
            BorderThickness="1,0,1,1" 
            CornerRadius="0,0,15,0"
                >
            <Label 
                x:Name="VersionLabel" 
                Margin="10,0,0,0" 
                Foreground="#FFB5C8D8" 
                Content="{x:Static properties:Resources.Version}"
                    />
        </Border>
    </StackPanel>
</UserControl>
